#ifndef RM_SENTRY_DEVICE_INC_MOTOR_DRIVER_H_
#define RM_SENTRY_DEVICE_INC_MOTOR_DRIVER_H_

#include <stdint.h>

// #define CHASSIS_CAN hcan1
// #define GIMBAL_CAN hcan2

/* CAN send and receive ID */
typedef enum
{
	//底盘CAN1控制的电机
    CAN_CHASSIS_ALL_ID = 0x200,
    CAN_3508_M1_ID = 0x201,
    CAN_3508_M2_ID = 0x202,
    CAN_3508_M3_ID = 0x203,
    CAN_3508_M4_ID = 0x204,
	CAN_YAW_MOTOR_ID = 0x205,
	
	//云台CAN2控制的电机
	shoot0_3508_ID = 0x205,			//0 左摩擦轮  1 右摩擦轮
    shoot1_3508_ID = 0x207,  
    CAN_PIT_MOTOR_ID = 0x206,
	CAN_TRIGGER_MOTOR_ID = 0x208,	//步兵拨弹盘在上
	
    CAN_GIMBAL_ALL_ID = 0x1FF,

} can_msg_id_e;

//rm motor data
typedef struct
{
    uint16_t ecd;
    int16_t speed_rpm;
    int16_t given_current;
    uint8_t temperate;
    int16_t last_ecd;
} motor_measure_t;

void CAN2_cmd_gimbal(int16_t shoot0, int16_t pitch, int16_t shoot1, int16_t rev);
void CAN1_cmd_gimbal(int16_t yaw, int16_t trigger, int16_t motor3, int16_t motor4);
void CAN_cmd_chassis(int16_t motor1, int16_t motor2, int16_t motor3, int16_t motor4);
const motor_measure_t *get_yaw_gimbal_motor_measure_point(void);
const motor_measure_t *get_pitch_gimbal_motor_measure_point(void);
const motor_measure_t *get_trigger_motor_measure_point(void);
const motor_measure_t *get_chassis_motor_measure_point(uint8_t i)	;
void can_filter_init(void);

#endif 
